﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace Ecommerce.Pagamento
{
    public class GerarBoleto
    {
        public string GerarBoletoHSBC(int idPedido, string nome, string cpfCnpj, decimal valor)
        {
            string merchantId = ConfigurationManager.AppSettings["MerchanIdHsbc"];
            BoletoHSBC.PagadorBoleto pb = new BoletoHSBC.PagadorBoleto();
            pb.Url = ConfigurationManager.AppSettings["UrlBoletoHsbc"];

            BoletoHSBC.PagadorBoletoReturn retorno = pb.CreateBoleto(merchantId, idPedido.ToString(), nome, cpfCnpj, valor.ToString("c").Replace("R$", "").Trim(), "08", string.Empty, string.Empty, DateTime.Now.AddDays(3).ToString("dd/MM/aa"), string.Empty);
            return retorno.url;
        }
    }
}
